//
//  H264HWDecoder.h
//  IntellDev_new
//
//  Created by os on 2021/3/11.
//

#import <Foundation/Foundation.h>
#import <VideoToolbox/VideoToolbox.h>

NS_ASSUME_NONNULL_BEGIN

@protocol UpdateDecodedSampleBufferDelegate <NSObject>

@optional

- (void)updateDecodedSampleBuffer:(CMSampleBufferRef)sampleBuffer;

@end

@interface H264HWDecoder : NSObject

@property (nonatomic, assign) CMVideoFormatDescriptionRef formatDesc;
@property (nonatomic, assign) VTDecompressionSessionRef decompressionSession;

@property (nonatomic, weak) id<UpdateDecodedSampleBufferDelegate> updateDelegate;

@property (nonatomic, assign) int spsSize;
@property (nonatomic, assign) int ppsSize;

- (int)DecodeH264Frames:(unsigned char *)inputBuffer withLength:(int)length;

@end

NS_ASSUME_NONNULL_END
